import request from '@/utils/request'

/**
 * 查询文章类别
 * @returns
 */
export function getAllBlogTypes() {
  return request({
    url: '/blog/getAllTypes',
    method: 'get'
  })
}

/**
 * 查询全部文章
 * @param {*} pageNum
 * @param {*} pageSize
 * @returns
 */
export function getAllBlogs(pageNum, pageSize) {
  return request({
    url: '/blog/getAllBlogs',
    method: 'get',
    params: {
      pageNum,
      pageSize
    }
  })
}
/**
 * 查询文章
 * @param {*} data
 * @returns
 */
export function searchBlogList(data) {
  return request({
    url: '/blog/getBlogList',
    method: 'get',
    params: data
  })
}

export function getBlogDetail(id) {
  return request({
    url: '/blog/' + id,
    method: 'get'
  })
}

export function addBlogReview(data) {
  return request({
    url: '/blogReview/addReview',
    method: 'post',
    data
  })
}
